//
//  LFBNetTool.h
//  XiMLYa
//
//  Created by dllo on 16/5/11.
//  Copyright © 2016年 Tencent. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef void(^blockOfSuccess)(id result);
typedef void(^blockOfFailure)(NSError *error);

typedef NS_ENUM(NSUInteger, LFBResponseStyle) {
    LFBJSON,
    LFBDATA,
    LFBXML,
};

typedef NS_ENUM(NSUInteger, LFBRequestStyle) {
    LFBBodyJSON,
    LFBBodyString,
};

@interface LFBNetTool : NSObject

+ (void)getNetWithURL:(NSString *)url
                 Body:(id)body
               Header:(NSDictionary *)header
             Response:(LFBResponseStyle)response
              Success:(blockOfSuccess)success
              Failure:(blockOfFailure)failure;

+ (void)postNetWithURL:(NSString *)url
                  Body:(id)body
             BodyStyle:(LFBRequestStyle)bodyStyle
                Header:(NSDictionary *)header
              Response:(LFBResponseStyle)response
               Success:(blockOfSuccess)success
               Failure:(blockOfFailure)failure;

+ (void)archiverObject:(id)object
                 ByKey:(NSString *)key
              WithPath:(NSString *)path;

+ (id)unarchiverObjectByKey:(NSString *)key
                   WithPath:(NSString *)path;

@end
